//    Copyright (C) 2013  <lugocreation@gmail.com>
//
//    This program is free software: you can redistribute it and/or modify
//    it under the terms of the GNU General Public License as published by
//    the Free Software Foundation, either version 3 of the License, or
//    (at your option) any later version.
//
//    This program is distributed in the hope that it will be useful,
//    but WITHOUT ANY WARRANTY; without even the implied warranty of
//    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//    GNU General Public License for more details.
//
//    You should have received a copy of the GNU General Public License
//    along with this program.  If not, see <http://www.gnu.org/licenses/>.
package org.jpgolay.me.discount;

import java.io.Serializable;
import java.math.BigDecimal;

public class Discount
        implements Serializable {

    public Discount() {
    }

    public Discount(Integer id, String clientId, String articleId, BigDecimal remise, BigDecimal qtUn, BigDecimal qtDeux, BigDecimal qtTrois,
            BigDecimal remiseQtUn, BigDecimal remiseQtDeux, BigDecimal remiseQtTrois, String updateUserId, String updateTime) {
        setId(id);
        setClientId(clientId);
        setArticleId(articleId);
        setRemise(remise);
        setQtUn(qtUn);
        setQtDeux(qtDeux);
        setQtTrois(qtTrois);
        setRemiseQtUn(remiseQtUn);
        setRemiseQtDeux(remiseQtDeux);
        setRemiseQtTrois(remiseQtTrois);
        setUpdateUserId(updateUserId);
        setUpdateTime(updateTime);
    }

    public Discount(Discount otherData) {
        setId(otherData.getId());
        setClientId(otherData.getClientId());
        setArticleId(otherData.getArticleId());
        setRemise(otherData.getRemise());
        setQtUn(otherData.getQtUn());
        setQtDeux(otherData.getQtDeux());
        setQtTrois(otherData.getQtTrois());
        setRemiseQtUn(otherData.getRemiseQtUn());
        setRemiseQtDeux(otherData.getRemiseQtDeux());
        setRemiseQtTrois(otherData.getRemiseQtTrois());
        setUpdateUserId(otherData.getUpdateUserId());
        setUpdateTime(otherData.getUpdateTime());
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getId() {
        return id;
    }

    public void setClientId(String clientId) {
        this.clientId = clientId;
    }

    public String getClientId() {
        return clientId;
    }

    public void setArticleId(String articleId) {
        this.articleId = articleId;
    }

    public String getArticleId() {
        return articleId;
    }

    public void setRemise(BigDecimal remise) {
        this.remise = remise;
    }

    public BigDecimal getRemise() {
        return remise;
    }

    public void setQtUn(BigDecimal qtUn) {
        this.qtUn = qtUn;
    }

    public BigDecimal getQtUn() {
        return qtUn;
    }

    public void setQtDeux(BigDecimal qtDeux) {
        this.qtDeux = qtDeux;
    }

    public BigDecimal getQtDeux() {
        return qtDeux;
    }

    public void setQtTrois(BigDecimal qtTrois) {
        this.qtTrois = qtTrois;
    }

    public BigDecimal getQtTrois() {
        return qtTrois;
    }

    public void setRemiseQtUn(BigDecimal remiseQtUn) {
        this.remiseQtUn = remiseQtUn;
    }

    public BigDecimal getRemiseQtUn() {
        return remiseQtUn;
    }

    public void setRemiseQtDeux(BigDecimal remiseQtDeux) {
        this.remiseQtDeux = remiseQtDeux;
    }

    public BigDecimal getRemiseQtDeux() {
        return remiseQtDeux;
    }

    public void setRemiseQtTrois(BigDecimal remiseQtTrois) {
        this.remiseQtTrois = remiseQtTrois;
    }

    public BigDecimal getRemiseQtTrois() {
        return remiseQtTrois;
    }

    public void setUpdateUserId(String updateUserId) {
        this.updateUserId = updateUserId;
    }

    public String getUpdateUserId() {
        return updateUserId;
    }

    public void setUpdateTime(String updateTime) {
        this.updateTime = updateTime;
    }

    public String getUpdateTime() {
        return updateTime;
    }

    public String toString() {
        StringBuffer str = new StringBuffer("{");
        str.append("id=" + getId() + " " + "clientId=" + getClientId() + " " + "articleId=" + getArticleId() + " " + "remise=" + getRemise() + " " + "qtUn=" + getQtUn() + " " + "qtDeux=" + getQtDeux() + " " + "qtTrois=" + getQtTrois() + " " + "remiseQtUn=" + getRemiseQtUn() + " " + "remiseQtDeux=" + getRemiseQtDeux() + " " + "remiseQtTrois=" + getRemiseQtTrois() + " " + "updateUserId=" + getUpdateUserId() + " " + "updateTime=" + getUpdateTime());
        str.append('}');
        return str.toString();
    }

    public boolean equals(Object pOther) {
        if (pOther instanceof Discount) {
            Discount lTest = (Discount) pOther;
            boolean lEquals = true;
            if (id == null) {
                lEquals = lEquals && lTest.id == null;
            } else {
                lEquals = lEquals && id.equals(lTest.id);
            }
            if (clientId == null) {
                lEquals = lEquals && lTest.clientId == null;
            } else {
                lEquals = lEquals && clientId.equals(lTest.clientId);
            }
            if (articleId == null) {
                lEquals = lEquals && lTest.articleId == null;
            } else {
                lEquals = lEquals && articleId.equals(lTest.articleId);
            }
            if (remise == null) {
                lEquals = lEquals && lTest.remise == null;
            } else {
                lEquals = lEquals && remise.equals(lTest.remise);
            }
            if (qtUn == null) {
                lEquals = lEquals && lTest.qtUn == null;
            } else {
                lEquals = lEquals && qtUn.equals(lTest.qtUn);
            }
            if (qtDeux == null) {
                lEquals = lEquals && lTest.qtDeux == null;
            } else {
                lEquals = lEquals && qtDeux.equals(lTest.qtDeux);
            }
            if (qtTrois == null) {
                lEquals = lEquals && lTest.qtTrois == null;
            } else {
                lEquals = lEquals && qtTrois.equals(lTest.qtTrois);
            }
            if (remiseQtUn == null) {
                lEquals = lEquals && lTest.remiseQtUn == null;
            } else {
                lEquals = lEquals && remiseQtUn.equals(lTest.remiseQtUn);
            }
            if (remiseQtDeux == null) {
                lEquals = lEquals && lTest.remiseQtDeux == null;
            } else {
                lEquals = lEquals && remiseQtDeux.equals(lTest.remiseQtDeux);
            }
            if (remiseQtTrois == null) {
                lEquals = lEquals && lTest.remiseQtTrois == null;
            } else {
                lEquals = lEquals && remiseQtTrois.equals(lTest.remiseQtTrois);
            }
            if (updateUserId == null) {
                lEquals = lEquals && lTest.updateUserId == null;
            } else {
                lEquals = lEquals && updateUserId.equals(lTest.updateUserId);
            }
            if (updateTime == null) {
                lEquals = lEquals && lTest.updateTime == null;
            } else {
                lEquals = lEquals && updateTime.equals(lTest.updateTime);
            }
            return lEquals;
        } else {
            return false;
        }
    }

    public int hashCode() {
        int result = 17;
        result = 37 * result + (id == null ? 0 : id.hashCode());
        result = 37 * result + (clientId == null ? 0 : clientId.hashCode());
        result = 37 * result + (articleId == null ? 0 : articleId.hashCode());
        result = 37 * result + (remise == null ? 0 : remise.hashCode());
        result = 37 * result + (qtUn == null ? 0 : qtUn.hashCode());
        result = 37 * result + (qtDeux == null ? 0 : qtDeux.hashCode());
        result = 37 * result + (qtTrois == null ? 0 : qtTrois.hashCode());
        result = 37 * result + (remiseQtUn == null ? 0 : remiseQtUn.hashCode());
        result = 37 * result + (remiseQtDeux == null ? 0 : remiseQtDeux.hashCode());
        result = 37 * result + (remiseQtTrois == null ? 0 : remiseQtTrois.hashCode());
        result = 37 * result + (updateUserId == null ? 0 : updateUserId.hashCode());
        result = 37 * result + (updateTime == null ? 0 : updateTime.hashCode());
        return result;
    }
    private Integer id;
    private String clientId;
    private String articleId;
    private BigDecimal remise;
    private BigDecimal qtUn;
    private BigDecimal qtDeux;
    private BigDecimal qtTrois;
    private BigDecimal remiseQtUn;
    private BigDecimal remiseQtDeux;
    private BigDecimal remiseQtTrois;
    private String updateUserId;
    private String updateTime;
}
